


<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="userProfile.title"/></title>
    <meta name="heading" content="<fmt:message key='userProfile.heading'/>"/>
    <meta name="menu" content="AdminMenu"/>
    <script type="text/javascript" src="<c:url value='/scripts/selectbox.js'/>"></script>

</head>

<div class="jquery_tab_container">
    <span class="heading_tab advanced_link active tab1"><fmt:message key="admin.institutions"/></span>
</div>

<div class="jquery_tab">
    <div class="content_block"> </div>
<form:form commandName="userInstitutionsForm" method="post" action="chooseinstitution"  id="userInstitutionsForm">
<form:hidden path="user.id"/>


<ul>

        <appfuse:label styleClass="desc" key="field.userName"/>
        <form:input disabled="true" path="user.username" id="name" cssClass="input-medium left" cssErrorClass="input-medium left error" style="background-color: #ccc;" maxlength="1000"/>
        <br /><br />



            <appfuse:label styleClass="desc" key="userInstitutionsForm.institution"/>
            <input class="input-medium" id="institution" value="${userInstitutionsForm.institution.institutionName}" style="width: 600px;" />
            <form:hidden id="institutionId" path="institution.id"/>


     
                    <br /><br />





    <p class="buttonBar bottom">
      <input type="submit" class="button" name="save" onclick="bCancel=false" value="<fmt:message key="button.save"/>"/>

     <input type="button" class="button" name="cancel" value="<fmt:message key="button.cancel"/>" onclick="location.href='<c:url value="/userinstitutionsearch"/>'"/>
    </p>
</ul>

     <display:table name="userInstitutionsForm.selectedInstitutions"  class="table" requestURI="" id="selectedInstitutions" export="false" pagesize="25">

       
        <display:column property="institution.institutionName" sortable="true" titleKey="institution.institutionName"/>
        <display:setProperty name="paging.banner.item_name"><fmt:message key="workPosition.institutionName"/></display:setProperty>
        <display:setProperty name="paging.banner.items_name"><fmt:message key="codex.institutions"/></display:setProperty>

    </display:table>

</form:form>
</div>
<script type="text/javascript">
    Form.focusFirstElement($('userForm'));
    highlightFormElements();
</script>

<v:javascript formName="user" staticJavascript="false"/>
<script type="text/javascript" src="<c:url value="/scripts/validator.jsp"/>"></script>

    <script type="text/javascript">
 new Autocomplete('institution', {
    serviceUrl:'<c:url value="/hello.json" />',
    minChars:2,
    clazz: "Institution",
    parent: "",
    maxHeight:500,
    width:600,
    deferRequestBy:300,
    // callback function:
    onSelect: function(value, data){
        jQuery("#institutionId").val(data);
    }
  });
</script>



